package com.xiaojianone.config;

import com.xiaojianone.interceptor.LoginProtectedInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * ClassName  WebMVCConfig
 * Author  XiaojianOne
 * Date  2025/2/18 22:58
 * Version  8.0
 */

@Configuration
public class WebMVCConfig implements WebMvcConfigurer {

    @Autowired
    private LoginProtectedInterceptor loginProtectedInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(loginProtectedInterceptor).addPathPatterns("/headline/**");
    }
}
